﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using LINQSamples.Data;

namespace Web.Samples
{
    public partial class IndexSelect : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.BindImperative();
        }

        private void BindQuery()
        {
        }

        private void BindImperative()
        {
            var query = Customer.GetCustomers().Select((c, index) => new { Index = index, Name = c.AccountNumber }).Take(10);

            foreach (var o in query)
                this.litImperativeResults.Text += string.Format("Index: {0} Acct Number: {1}<br />\n", o.Index, o.Name);
        }
    }
}
